﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeGen.TS.Generation
{
    public interface ICodeGenerator
    {
        /// <summary>
        /// Set this to control the behavior of including base classes
        /// </summary>
        BaseTypeMode BaseTypeMode {get;set;}

        /// <summary>
        /// The filename to output the generated code to
        /// </summary>
        string OutputFileName { get; set; }

        /// <summary>
        /// The modulname of the generator
        /// </summary>
        string ModulName { get; set; }

        /// <summary>
        /// The name that shall be given to the object
        /// </summary>
        string NewTypeName { get; set; }

        /// <summary>
        /// True if you do want to use KnockoutObservables, false if not
        /// </summary>
        bool UseObservable { get; set; }

        /// <summary>
        /// The type that will be serialized
        /// </summary>
        Type Type { get; set; }

        /// <summary>
        /// Only used to specifiy the intend at wich the object is inserted in the file
        /// </summary>
        string BaseIntend { get; set; }

        /// <summary>
        /// Method for finally creating the code
        /// </summary>
        string GenerateOutput();

        /// <summary>
        /// Value from settings file. Is set to 0 to not serialize any subojects, -1 for serializing all subobjects or any positive integer number to serialize a maximul of tree levels of the object tree
        /// </summary>
        int RecursionLevel { get; set; }

        /// <summary>
        /// Returns true if all dependencies of that object are loaded and false if not
        /// </summary>
        bool IsPreparedForOutput { get; }

        /// <summary>
        /// Registres Dependencies on other generators. Should set IsPreparedForOutput to true afterwards
        /// If allowsRecursion is false, there should not be any dependencies which are to be registred
        /// </summary>
        void PrepareForOutput(bool allowsRecursion);


    }
}
